Skip to content

Add embedding generation contracts#243

Closed
chubes4 wants to merge 2 commits into
WordPress:trunkfrom
chubes4:feature/issue-242-embedding-contracts
Closed

Add embedding generation contracts#243
chubes4 wants to merge 2 commits into
WordPress:trunkfrom
chubes4:feature/issue-242-embedding-contracts

Conversation

@chubes4

@chubes4 chubes4 commented Jun 3, 2026

Copy link
Copy Markdown

Summary

  • Add first-class embedding generation contracts and an EmbeddingResult DTO.
  • Add OpenAI-compatible embedding request/response handling for providers to reuse.
  • Add prompt builder helpers for embedding generation and embedding dimensions.

Fixes #242
Unblocks WordPress/ai-provider-for-openai#32

Testing

  • composer test:unit -- --filter 'EmbeddingResultTest|AbstractOpenAiCompatibleEmbeddingGenerationModelTest'
  • composer phpstan
  • composer phpcs

AI assistance

  • AI assistance: Yes
  • Tool(s): OpenCode (gpt-5.5)
  • Used for: Drafted the embedding contract implementation and tests; Chris remains responsible for review and acceptance.

@github-actions

github-actions Bot commented Jun 3, 2026

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the props-bot label.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: chubes4 <extrachill@git.wordpress.org>

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@chubes4

chubes4 commented Jun 4, 2026

Copy link
Copy Markdown
Author

Controller triage note: this PR has a PHP 7.4 test failure while #244 for the same issue is fully green. Please either fix the PHP 7.4 failure and clarify how #243 composes with #244, or close/supersede this PR if #244 is the intended canonical embedding API branch.

@chubes4

chubes4 commented Jun 4, 2026

Copy link
Copy Markdown
Author

Closing this as superseded by #244, which carries the canonical embedding API branch and is already green. This branch still used the older embedding option shape and had a PHP 7.4 enum fixture failure, so keeping #244 as the single embedding contract source avoids splitting the stack across incompatible contracts.

@chubes4 chubes4 closed this Jun 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement embedding generation contracts and client APIs

1 participant